package project.Util;

import com.alibaba.fastjson2.JSON;
import project.Pojo.RequestJsonPojo.MessageResult;


public class MessageUtil {

    public static String getMessage(boolean isSystem, String to, Object message) {
        MessageResult mr = new MessageResult();
        mr.setSystem(isSystem);
        if (to != null) {
            mr.setTo(to);
        }
        mr.setMessage(message);

        return JSON.toJSONString(mr);
    }
}
